<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String userid=request.getParameter("id");
%>
<%@taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html>
<html>
	<head>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/CSS/bootstrap.css" />
		<link href="${pageContext.request.contextPath}/CSS/base.css" rel="stylesheet">
		<link href="${pageContext.request.contextPath}/CSS/animate.min.css" rel="stylesheet">
		<style type="text/css">
    .profile{
      text-align: center;
      padding: 36px 36px 36px 36px;
      background-color: #fff;
    }
    </style>

		<title>图片分享社区 - 个人信息</title>
  </head>

  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container" >
        <div class="navbar-header">
          <a class="navbar-brand" href="fonthead.action">
						<span class="nav-title">图片分享社区</span>
					</a>
        </div>

        <div id="navbar" class="navbar-collapse collapse" >
          <div class="navbar-form navbar-right">
						<li class="dropdown" >
			        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
								<s:if test="#session.IMG==null">
								<img class="img-circle" style="height: 40px;" src="${pageContext.request.contextPath}/IMG/headimg.jpg">
							</s:if>
							<s:else>
							<img class="img-circle" style="height: 40px;" src='<s:property value="#session.IMG"/>'>
							</s:else>
							</a>
						
						<s:if test="#session.ID==null">
			        <ul class="dropdown-menu">
			         <li><a href="loginfont.action">登陆</a></li>
			           <li role="separator" class="divider"></li>
			           <li><a href="registerpage.action">注册</a></li>
		
			        </ul>
			        </s:if>
			        <s:else>
			         <ul class="dropdown-menu">

			      <li><a href="userprofile.action?id=<s:property value="#session.ID"/>">个人主页</a></li>
			          <li role="separator" class="divider"></li>
			              <li><a href="alelterpassword.action">修改密码</a></li>
			           <li role="separator" class="divider"></li>
			          <li><a href="logoutfont.action">注销</a></li>
			        </ul>
			        </s:else>
			      </li>
          </div>
        </div>
      </div>
    </nav>

    <div class="container main-body">
      <div class="row">
        <div class="col-md-2 profile animated slideInLeft">
          <div>
            <img class="img-circle" style="height: 100px;" src='<s:property value="user.headimg"/>'>
          </div>
          <div>
        
            <h2><s:property value="user.username"/></h2>       
          </div>        
        </div>


        <div class="col-md-10">
    			<div class="row">
    			<s:if test="sharelist.size()==0">
    		
    			<h3 class="text-info animated shake" style="text-align:center;margin-top:10%;">你还未分享任何图片内容</h3>
    		
    			</s:if>
    			<s:else>
<s:iterator value="sharelist" id="share">
            <div class="col-md-6 animated bounceInRight">
    					<div class="thumbnail">
    						<a href="contentdetails.action?id=<s:property value="#share.shareid"/>">
    						<img src='<%=path%><s:property value="#share.imagpath"/>' class="img-thumbnail img-responsive"></a>

    							<div class="row info-row">
    								<div class="col-md-2 info-img center-align">
    									<img class="img-circle info-img" src="<s:property value="#share.headimg"/>">
    								</div>

    								<div class="col-md-8">
    									<div class="info-title"><s:property value="#share.title"/></div>
    									<div>
    										<span>by</span>
    										<span><s:property value="#share.username"/></span>
    									</div>
    								</div>
                                    <s:if test="#session.ID==#share.id">
    								<div class="col-md-2 center-align">
    									<div>
    									<span class="glyphicon glyphicon-heart info-love" style="color:red;"></span>
    									<span><s:property value="#share.likecount"/></span>
    			    				
    									</div>
    								
    								<a role="button" class="btn btn-danger" class="list-group-item" href="deletecontent.action?id=<s:property value="#share.shareid"/>&&type=1">删除</a>
    								</div>
    									</s:if>
    									<s:else>
    									<div class="col-md-2 center-align">
    									<div>
    									<a href="likecontent.action?id=<s:property value="#share.shareid"/>"><span class="glyphicon glyphicon-heart info-love" style="color:red;"></span></a>
    									<span><s:property value="#share.likecount"/></span>    			    				
    									</div>   								   					
    								</div>
    									
    									</s:else>
    							</div>
    					</div>
    				</div>
 </s:iterator>
    		</s:else>
    		    				
   			</div>
        </div>
      </div>
		</div>

    		<!--footer-->
<footer>
    <div class="container" style="text-align:center">
        <div class="row">
            <div class="col-md-12">
                <p>
                    Copyright&nbsp;©&nbsp;2012-2015&nbsp;&nbsp;www.sharephoto.com&nbsp;&nbsp;粤ICP备13014270号-4
                </p>
            </div>
        </div>
    </div>
</footer>
<!--footer-->
<script src="${pageContext.request.contextPath}/JS/jquery-1.12.3.min.js"></script>
<script src="${pageContext.request.contextPath}/JS/bootstrap.min.js"></script>
  </body>
</html>
